// 登录相关的接口
//@ts-ignore 
import request from "@/utils/request";
import type { loginForm, loginResponseData, userInfoReponseDate } from "./type";
enum API {
  // LOGIN_URL = "/admin/login",
  LOGIN_URL = "/api/login",
  USERINFO_URL = "/admin/info",
  LOGOUT_URL = "/admin/logout",
}
// 登录接口
export const reqLogin = (data: loginForm) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data);
// 获取用户信息
export const reqUserInfo = () =>
  request.get<any, userInfoReponseDate>(API.USERINFO_URL);
// 退出登录
export const reqLogout = (data: any) =>
  request.post<any, any>(API.LOGOUT_URL, data);
